In the field of information communications technologies, a hot swapping technology is widely used. By using the hot swapping technology, a fault can be maintained and replaced without interrupting a service of a server or other IT devices, thereby improving maintainability of a device and robustness of a system. In the prior art, refer to a schematic diagram of a system 10 of a hot swappable device shown in FIG. 1. The hot swappable system 10 includes a host 11 and a hot swappable device 12. The hot swappable device 12 includes a port 121, a system control register 122, a firmware module 123, a notification button 126, and a power indicator 127. The port 121 includes a Peripheral Component Interface express Physical Layer 124 and a controller 125. The external host 11 establishes a communications link with the hot swappable device by using the port 121. The Peripheral Component Interface express Physical Layer 124 receives an instruction sent by the host 11. The Peripheral Component Interface express Physical Layer 124 and the controller 125 execute a related service according to the instruction transmitted by the host 11. A process in the prior art in which a port performs a hot removal operation is described below with reference to FIG. 1.
1. A user presses the notification button 126 to trigger a hot removal request. After receiving the hot removal request, the system control register 122 transmits the hot removal request to the firmware module 123. After receiving the hot removal request, the firmware module 123 sends an interrupt request to the host 11. The host 11 presents again an interrupt acknowledgment to the user according to the interrupt request, and after the host 11 obtains an acknowledgment from the user, the host 11 sends an interrupt response to the firmware module.
2. After receiving the interrupt response, the firmware module 123 detects that the host 11 does not send data any longer, determines that a current service is completed, and prohibits use of a slot of the port.
3. The power indicator 127 indicates that the user can perform the hot removal operation.
The foregoing steps briefly describe operation steps of hot removing the port 121 from the host 11. Subsequently, if the port 121 needs to be re-inserted into the host to perform a hot insertion step, the notification button 126 is also required to trigger a hot insertion request. The user can perform a hot insertion operation only after the power indicator 127 indicates that the user can perform the hot insertion operation. Specific steps are similar to the foregoing steps, and details are not described herein again by using an example.
It can be learned from the foregoing example that when the user performs a hot insertion and hot removal operation, the hot swappable device needs to be notified in advance, so that after the hot swappable device is well-prepared, the hot swappable device notifies, by using an indicator, the user that the hot insertion and hot removal operation can be performed. The user is not allowed to perform an insertion and removal action on the hot swappable device without notifying the hot swappable device. The user needs to wait for an indication before performing the operation. The operation is complex and a waiting time is long. In addition, the hot insertion and hot removal operation needs to be supported by auxiliary hardware such as the notification button and the power indicator, and the foregoing auxiliary hardware extremely wastes resources on a plate electrode.